home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / pingnt1a / dsping.frm (.txt) next >
Visual Basic Form  |  1999-01-27  |  15KB  |  357 lines

  1. VERSION 5.00
  2. Begin VB.Form frmMain 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "Ping Server"
  5.    ClientHeight    =   3240
  6.    ClientLeft      =   1740
  7.    ClientTop       =   2025
  8.    ClientWidth     =   5640
  9.    BeginProperty Font 
  10.       Name            =   "Times New Roman"
  11.       Size            =   8.25
  12.       Charset         =   0
  13.       Weight          =   400
  14.       Underline       =   0   'False
  15.       Italic          =   0   'False
  16.       Strikethrough   =   0   'False
  17.    EndProperty
  18.    Icon            =   "dsPing.frx":0000
  19.    LinkTopic       =   "Form1"
  20.    MaxButton       =   0   'False
  21.    MinButton       =   0   'False
  22.    PaletteMode     =   1  'UseZOrder
  23.    ScaleHeight     =   3240
  24.    ScaleWidth      =   5640
  25.    StartUpPosition =   2  'CenterScreen
  26.    Begin VB.TextBox txTTL 
  27.       BeginProperty Font 
  28.          Name            =   "MS Sans Serif"
  29.          Size            =   8.25
  30.          Charset         =   0
  31.          Weight          =   400
  32.          Underline       =   0   'False
  33.          Italic          =   0   'False
  34.          Strikethrough   =   0   'False
  35.       EndProperty
  36.       Height          =   285
  37.       Left            =   2520
  38.       TabIndex        =   7
  39.       Text            =   "5"
  40.       Top             =   480
  41.       Width           =   735
  42.    End
  43.    Begin VB.CommandButton btnExit 
  44.       Caption         =   "E&xit"
  45.       BeginProperty Font 
  46.          Name            =   "MS Sans Serif"
  47.          Size            =   8.25
  48.          Charset         =   0
  49.          Weight          =   400
  50.          Underline       =   0   'False
  51.          Italic          =   0   'False
  52.          Strikethrough   =   0   'False
  53.       EndProperty
  54.       Height          =   375
  55.       Left            =   4080
  56.       TabIndex        =   5
  57.       Top             =   2760
  58.       Width           =   1455
  59.    End
  60.    Begin VB.CommandButton btnPing 
  61.       Caption         =   "&Ping"
  62.       Default         =   -1  'True
  63.       BeginProperty Font 
  64.          Name            =   "MS Sans Serif"
  65.          Size            =   8.25
  66.          Charset         =   0
  67.          Weight          =   400
  68.          Underline       =   0   'False
  69.          Italic          =   0   'False
  70.          Strikethrough   =   0   'False
  71.       EndProperty
  72.       Height          =   375
  73.       Left            =   240
  74.       TabIndex        =   4
  75.       Top             =   2760
  76.       Width           =   1455
  77.    End
  78.    Begin VB.ListBox lbReturn 
  79.       BeginProperty Font 
  80.          Name            =   "MS Sans Serif"
  81.          Size            =   8.25
  82.          Charset         =   0
  83.          Weight          =   400
  84.          Underline       =   0   'False
  85.          Italic          =   0   'False
  86.          Strikethrough   =   0   'False
  87.       EndProperty
  88.       Height          =   1620
  89.       Left            =   240
  90.       TabIndex        =   2
  91.       Top             =   1080
  92.       Width           =   5295
  93.    End
  94.    Begin VB.TextBox txIPAddress 
  95.       BeginProperty Font 
  96.          Name            =   "MS Sans Serif"
  97.          Size            =   8.25
  98.          Charset         =   0
  99.          Weight          =   400
  100.          Underline       =   0   'False
  101.          Italic          =   0   'False
  102.          Strikethrough   =   0   'False
  103.       EndProperty
  104.       Height          =   285
  105.       Left            =   2520
  106.       TabIndex        =   1
  107.       Text            =   "13.231.214.45"
  108.       Top             =   120
  109.       Width           =   3015
  110.    End
  111.    Begin VB.Label Label3 
  112.       Alignment       =   1  'Right Justify
  113.       Caption         =   "Time To Live ((TTL) :"
  114.       BeginProperty Font 
  115.          Name            =   "MS Sans Serif"
  116.          Size            =   8.25
  117.          Charset         =   0
  118.          Weight          =   400
  119.          Underline       =   0   'False
  120.          Italic          =   0   'False
  121.          Strikethrough   =   0   'False
  122.       EndProperty
  123.       Height          =   255
  124.       Left            =   480
  125.       TabIndex        =   6
  126.       Top             =   480
  127.       Width           =   1935
  128.    End
  129.    Begin VB.Label Label2 
  130.       Caption         =   "Return Information :"
  131.       BeginProperty Font 
  132.          Name            =   "MS Sans Serif"
  133.          Size            =   8.25
  134.          Charset         =   0
  135.          Weight          =   400
  136.          Underline       =   0   'False
  137.          Italic          =   0   'False
  138.          Strikethrough   =   0   'False
  139.       EndProperty
  140.       Height          =   255
  141.       Left            =   240
  142.       TabIndex        =   3
  143.       Top             =   840
  144.       Width           =   1935
  145.    End
  146.    Begin VB.Label Label1 
  147.       Alignment       =   1  'Right Justify
  148.       Caption         =   "IP Address to send ping to :"
  149.       BeginProperty Font 
  150.          Name            =   "MS Sans Serif"
  151.          Size            =   8.25
  152.          Charset         =   0
  153.          Weight          =   400
  154.          Underline       =   0   'False
  155.          Italic          =   0   'False
  156.          Strikethrough   =   0   'False
  157.       EndProperty
  158.       Height          =   255
  159.       Left            =   120
  160.       TabIndex        =   0
  161.       Top             =   120
  162.       Width           =   2295
  163.    End
  164. Attribute VB_Name = "frmMain"
  165. Attribute VB_GlobalNameSpace = False
  166. Attribute VB_Creatable = False
  167. Attribute VB_PredeclaredId = True
  168. Attribute VB_Exposed = False
  169. '*******************************************************************
  170. '   PingVB
  171. '   This application implements a TCP/IP network ping
  172. '   using the ICMP.DLL provided as part of Windows 95 and
  173. '   Windows NT.
  174. '   IP_STATUS codes returned from IP APIs
  175. '*******************************************************************
  176. Private Const IP_STATUS_BASE = 11000
  177. Private Const IP_SUCCESS = 0
  178. Private Const IP_BUF_TOO_SMALL = (11000 + 1)
  179. Private Const IP_DEST_NET_UNREACHABLE = (11000 + 2)
  180. Private Const IP_DEST_HOST_UNREACHABLE = (11000 + 3)
  181. Private Const IP_DEST_PROT_UNREACHABLE = (11000 + 4)
  182. Private Const IP_DEST_PORT_UNREACHABLE = (11000 + 5)
  183. Private Const IP_NO_RESOURCES = (11000 + 6)
  184. Private Const IP_BAD_OPTION = (11000 + 7)
  185. Private Const IP_HW_ERROR = (11000 + 8)
  186. Private Const IP_PACKET_TOO_BIG = (11000 + 9)
  187. Private Const IP_REQ_TIMED_OUT = (11000 + 10)
  188. Private Const IP_BAD_REQ = (11000 + 11)
  189. Private Const IP_BAD_ROUTE = (11000 + 12)
  190. Private Const IP_TTL_EXPIRED_TRANSIT = (11000 + 13)
  191. Private Const IP_TTL_EXPIRED_REASSEM = (11000 + 14)
  192. Private Const IP_PARAM_PROBLEM = (11000 + 15)
  193. Private Const IP_SOURCE_QUENCH = (11000 + 16)
  194. Private Const IP_OPTION_TOO_BIG = (11000 + 17)
  195. Private Const IP_BAD_DESTINATION = (11000 + 18)
  196. '   The next group are status codes passed up on status indications to
  197. '   transport layer protocols.
  198. Private Const IP_ADDR_DELETED = (11000 + 19)
  199. Private Const IP_SPEC_MTU_CHANGE = (11000 + 20)
  200. Private Const IP_MTU_CHANGE = (11000 + 21)
  201. Private Const IP_UNLOAD = (11000 + 22)
  202. Private Const IP_ADDR_ADDED = (11000 + 23)
  203. Private Const IP_GENERAL_FAILURE = (11000 + 50)
  204. Private Const MAX_IP_STATUS = 11000 + 50
  205. Private Const IP_PENDING = (11000 + 255)
  206. '   option information for network ping, we don't implement these here as this is
  207. '   a simple sample (simon says).
  208. Private Type ip_option_information
  209.     Ttl             As Byte     'Time To Live
  210.     Tos             As Byte     'Type Of Service
  211.     Flags           As Byte     'IP header flags
  212.     OptionsSize     As Byte     'Size in bytes of options data
  213.     OptionsData     As Long     'Pointer to options data
  214. End Type
  215. '   structure that is returned from the ping to give status and error information
  216. Private Type icmp_echo_reply
  217.     Address         As Long             'Replying address
  218.     Status          As Long             'Reply IP_STATUS, values as defined above
  219.     RoundTripTime   As Long             'RTT in milliseconds
  220.     DataSize        As Integer          'Reply data size in bytes
  221.     Reserved        As Integer          'Reserved for system use
  222.     DataPointer     As Long             'Pointer to the reply data
  223.     Options         As ip_option_information    'Reply options
  224.     Data            As String * 250     'Reply data which should be a copy of the string sent, NULL terminated
  225.                                         ' this field length should be large enough to contain